<template>
	<view>
		<view class="article">
			<view class="title">{{article.title}}</view>
			<view class="content">
					<u-parse :content="article.content"></u-parse>
			</view>
		</view>
		<editor id="editor" class="ql-container" placeholder="开始输入..." showImgSize showImgToolbar showImgResize ></editor>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				article:{}
				
			}
		},
		onLoad({id}) {
			//获取文章信息
			this.getArticleById(id);
			//判断用户是否登录
			//this.$route.query.id
		},
		methods: {
			getArticleById(id){
				let params={
					id:id
				}
				uni.$u.http.get('/api/article/one',{
					params:params,
					}).then(res=>{
						console.log(res)
						if(res.id!=0){
							this.article=res;
						}
						
					}).catch(err=>{
						
					})
			}
			
		}
	}
</script>

<style>

</style>
